let typeMap = new Map([
  [
    1,
    {
      name: "wiremap.g/icon_g/",
      type: ".png",
    },
  ],
  [
    2,
    {
      name: "wiremap.g/meta_g/",
      type: ".g",
    },
  ],
  [
    3,
    {
      name: "wiremap.g/icon_svg/",
      type: ".svg",
    },
  ],
]);
const baseUrl = process.env.NODE_ENV == "development" ? "/wiremap/" : "/";
const resourceId = ["425", "426", "428", "429", "430", "434"];

export default function imgSrc(type, id) {
  if (type == 3) {
    if (!resourceId.includes(id)) {
      id = "0";
    }
  }
  return baseUrl + typeMap.get(type).name + id + typeMap.get(type).type;
}
